<div class="container blog-content-container">
  <div class="row">
    <div class="col-md-4 col-xl-3">
      <div *ngIf="userService.currentUser!=null">
        <div class="row">
          <div class="col-md-12">
            <span>
              <a routerLink="/user/userspace" title="waylau" [title]="userService.currentUser.username">
                <img [src]="userService.currentUser.avatar == null ? 'assets/images/avatar-default.jpg' : userService.currentUser.avatar"
                     class="blog-avatar-230">
              </a>
            </span>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <h2 class="card-text">{{userService.currentUser.nickname}}</h2>
            <h4 class="card-text">{{userService.currentUser.username}}</h4>
          </div>
        </div>
        <div class="row ">
          <div class="col-md-12">
            <h5><i class="fa fa-envelope-o" aria-hidden="true"></i>
              <a [href]="'mailto:'+ userService.currentUser.email">{{userService.currentUser.email}}</a>
            </h5>
          </div>
        </div>
      </div>
      <div *ngIf="userService.currentUser==null">
        <h3>用户不存在</h3>
      </div>


      <hr>

      <!-- 分类 -->

      <div class="panel panel-default" id="catalogRepleace">
        <div class="panel-heading">
          <h5 class="panel-title">
            <i class="fa fa-bars" aria-hidden="true"></i> 分类
            <a href="javascript:void(0)"
               class="blog-right"
               (click)="showEditCatalogDialog(null);">
              <i class="fa fa-plus" aria-hidden="true"></i>
            </a>
          </h5>
        </div>

        <ul class="list-group" *ngIf="catalogs?.length > 0">
          <li class="list-group-item" *ngFor="let catalog of catalogs">
            <a href="javascript:void(0)">{{catalog.name}}</a>
            <span class="blog-right">
                <a href="javascript:void(0)" (click)="showEditCatalogDialog(catalog);">
                  <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
                </a>
                <a href="javascript:void(0)" (click)="deleteCatalog(catalog);">
                   <i class="fa fa-times" aria-hidden="true"></i>
                </a>
            </span>
          </li>
        </ul>
      </div>
    </div>

  </div>

</div>


<p-dialog header="编辑/添加分类" [(visible)]="display" [modal]="true" [responsive]="true" [width]="350" [minWidth]="200" [minY]="70">
  <form>
    <div class="form-group">
      <label for="catalogName" class="control-label">名称</label>
      <input type="text" [(ngModel)]="catalog.name" name="catalogName" class="form-control" maxlength="30" id="catalogName" placeholder="请输入分类名称" >
    </div>
  </form>
  <p-footer>
    <button type="button" pButton icon="pi pi-check" (click)="editCatalog();" label="提交"></button>
    <button type="button" pButton icon="pi pi-close" (click)="display=false" label="关闭"></button>
  </p-footer>
</p-dialog>

<p-growl [(value)]="msgs"></p-growl>
